#region File Header
//----------------------------------------------------------------
// Copyright (C) 2002 Stefan Kyntchev
// All rights reserved.
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 
// OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 
// LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR 
// FITNESS FOR A PARTICULAR PURPOSE.
//----------------------------------------------------------------
#endregion File Header

namespace FlashBack.Web
{
	using System;
	using System.Collections;
	using System.ComponentModel;
	using System.Data;
	using System.Drawing;
	using System.Web;
	using System.Web.SessionState;
	using System.Web.UI;
	using System.Web.UI.WebControls;
	using System.Web.UI.HtmlControls;
	using System.Diagnostics;
	using System.Collections.Specialized;
	using System.Configuration;
	using System.Net;
	using AirWeb.ApplicationTools.Common;

	/// <summary>
	///    Summary description for Browser.
	/// </summary>
	public partial class Browser : System.Web.UI.Page
	{
		public string NavigatorFrame;

		public Browser()
		{
			Page.Init += new System.EventHandler(Page_Init);
		}

		protected void Page_Load(object sender, EventArgs e)
		{
			Response.Expires = -1;

			if (!IsPostBack)
			{
				// Verify that the browser is IE
				HttpBrowserCapabilities bc = Request.Browser;
				if(bc.Platform == "WinCE")
				{
					Server.Transfer("WhatIsNew.aspx");
				}

				/*else if(bc.Browser == "IE")
				{
					NavigatorFrame = "<FRAME id='Tree' SRC='PicNavigator.aspx'>";
				}
				else if(bc.Browser == "Netscape" && bc.MajorVersion == 6)
				{
					NavigatorFrame = "<FRAME id='Tree' SRC='PicDirTree.aspx?ShowHeader=yes'>";
				}
				else
				{
					Response.Write("<h1>Currently only Internet Explorer browser is supported!</h><br><h3>Please use Internet Explorer version 4.0 and above to access this site.<h3>");
					Response.Write("Your browser is: " + bc.Browser + " Version:" + bc.MajorVersion.ToString() + "." + bc.MinorVersion.ToString());
					Response.End();
				}*/

				NavigatorFrame = "<FRAME id='Tree' SRC='PicNavigator.aspx'>";


				if(! bc.JavaScript )
				{
					Response.Write("<h1>JavaScvript is required to access this site!</h><br><h3>Please use turn on JavaScript support in your browser.<h3>");
					Response.End();
				}

				// Log this login
				CommonHelper.LogUserLogin(Context.User.Identity.Name,Request.UserHostName);
			}
		}

		protected void Page_Init(object sender, EventArgs e)
		{
			//
			// CODEGEN: This call is required by the ASP+ Windows Form Designer.
			//
			InitializeComponent();
		}

		/// <summary>
		///    Required method for Designer support - do not modify
		///    the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
		}
	}
}
